package com.weitu.majorHazard.deviceLocation.service.impl;

import com.weitu.majorHazard.deviceLocation.entity.DeviceLocation;
import com.weitu.majorHazard.deviceLocation.mapper.DeviceLocationMapper;
import com.weitu.majorHazard.deviceLocation.service.DeviceLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by smp on 2017/5/5.
 */
@Service
public class DeviceLocationServiceImpl implements DeviceLocationService {

    private final DeviceLocationMapper deviceLocationMapper;

    @Autowired
    public DeviceLocationServiceImpl(DeviceLocationMapper deviceLocationMapper){
        this.deviceLocationMapper=deviceLocationMapper;
    }


    @Override
    public int queryCount(Map<String, Object> map) {
        return this.deviceLocationMapper.queryCount(map);
    }

    @Override
    public List<DeviceLocation> queryList(Map<String, Object> map) {
        return this.deviceLocationMapper.queryList(map);
    }

    @Override
    public int insertDeviceLocation(DeviceLocation deviceLocation) {
        return this.deviceLocationMapper.insertDeviceLocation(deviceLocation);
    }

    @Override
    public DeviceLocation queryDeviceLocationById(String id) {
        return this.deviceLocationMapper.queryDeviceLocationById(id);
    }

    @Override
    public int updateDeviceLocation(DeviceLocation deviceLocation) {
        return this.deviceLocationMapper.updateDeviceLocation(deviceLocation);
    }

    @Override
    public int deleteDeviceLocation(String id) {
        return this.deviceLocationMapper.deleteDeviceLocation(id);
    }

    @Override
    public boolean judgement(Map<String, Object> map) {
        int count=this.deviceLocationMapper.judgement(map);
        if(count>0){
            return false;
        }
        else{
            return true;
        }

    }
}
